package com.may.demo.core;

import lombok.Data;

import java.io.Serializable;

/**
 * @program: demo
 * @description:
 * @author: Bobby.Ma
 * @create: 2020-11-14 13:52
 **/
@Data
public class R<T> implements Serializable {

    private String msg;
    private Integer code;
    private T data;

    public R(T data){
        this.data = data;
        this.msg = RCode.SUCCESS.getMsg();
        this.code = RCode.SUCCESS.getCode();
    }

    public static <T> R<T> success(T data){
        return new R(data);
    }
}
